package com.ada.tft_sport.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ada.tft_sport.R;

public class StartupFragment extends Fragment{
	
	private View startupFragment; // 主界面
	
	private FragmentManager fManager; // 碎片管理器
	private FragmentTransaction fTransaction; // 获取事务处理对象
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		// 每次切换此页面时，不需要重新创建Fragment对象
		setRetainInstance(true);
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

		// 实例化布局文件
		startupFragment = inflater.inflate(R.layout.fragment_startup, container,
				false);

		fManager = getActivity().getSupportFragmentManager(); 	// 获得碎片管理器
		fTransaction = fManager.beginTransaction(); 			// 获取事务处理对象
		
		
		return startupFragment; // 返回视图对象
		
	}

}
